/*
 * IConfirmOrderModel.java
 * business
 *
 * Created by ChenTao on 2017/2/15.
 *
 * Copyright (c) 2017年 yidiandao. All rights reserved.
 */

package com.yidiandao.business.data.model;

import com.yidiandao.business.data.ShopPayWays;
import com.yidiandao.business.data.bean.ShareEntity;
import com.yidiandao.business.data.bean.Shop;
import com.yidiandao.business.data.response.QueryConfirmOrderDataResponse;
import com.yidiandao.business.data.response.QueryMultiPayWaysResultResponse;
import com.yidiandao.business.data.response.SubmitOrderResponse;
import com.yidiandao.business.ui.widget.listview.DisplayListItem;

import java.util.List;

/**
 * ConfirmOrderModel
 * <p>
 * <p>Created by ChenTao(chentao7v@gmail.com) on 2017/2/15 16:07
 */
public interface IConfirmOrderModel {

    interface OnLoadListItemsListener {

        void onSuccess(List<DisplayListItem> displayListItems);

        void onFailed();
    }

    interface OnSubmitOrderListener {

        void onSuccess(SubmitOrderResponse response);

        void onFailed();
    }

    interface OnPayResultListener {

        void onSuccess(List<DisplayListItem> displayListItems);

        void onPayResult(ShareEntity shareData, String payTitle, boolean success);

        void onFailed();
    }

    interface OnQueryShippingFeeByAddressListener {

        void onSuccess(List<Shop> shopList);

        void onFailed();
    }

    interface OnLoadPayWayListListener {

        void onSuccess(List<ShopPayWays> payWays, float onlinePayLimit);

        void onFailed();

    }

    interface OnChoosePayWaysListener {

        void onSuccess();

    }

    interface OnConfirmOrderResponseListener {

        void onSuccess(QueryConfirmOrderDataResponse response);

        void onFailed();
    }

    interface OnInventoryListener {

        void onSuccess(List<DisplayListItem> displayListItems, int total);

        void onFailed();

    }

    interface OnMultiPayWayResultListener {

        void onSuccess(QueryMultiPayWaysResultResponse.Data data);

        void onFailed();
    }

    /**
     * 购物车结算
     */
    void loadOthersConfirmOrderData(String tag, OnConfirmOrderResponseListener listener);

    /**
     * 设置是否需要刷新购物车
     */
    void setNeedRefreshShoppingCart(boolean refreshShoppingCart);

    /**
     * 获取确认订单的商品列表
     */
    void loadInventory(String tag, OnInventoryListener listener);

    /**
     * 获取配送方式
     */
    void getShippingInfo(
            String pagerTag,
            String addressId,
            OnLoadListItemsListener listener);

    void updateShippingFeeByAddress(
            String tag,
            String addressId,
            String recJson,
            String favourableJson,
            boolean isHomeActivityGoods,
            String goodsId,
            int goodsNumber,
            OnQueryShippingFeeByAddressListener listener);

    /**
     * 提交订单 以结算
     */
    void submitOrder(String tag, String message, OnSubmitOrderListener listener);

    /**
     * 订单提交之后访问的接口
     *
     * @param orderPayId 订单提交之后返回的orderPayId
     * @param orderId    单个订单的id
     */
    void loadPayResult(String orderPayId, String orderId, String tag, OnPayResultListener listener);

    /**
     * 获取支付方式列表
     */
    void getPayWayList(String tag, OnLoadPayWayListListener listener);

    /**
     * 设置支付方式
     */
    void changePayWays(String tag, String payWaysJson, OnChoosePayWaysListener listener);

    /**
     * 多种支付方式 订单提交成功页面(包含在线支付时使用)
     */
    void loadMultiPayWaysResult(String tag, String orderPayId, OnMultiPayWayResultListener listener);

}
